package com.plugin.manage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.plugin.core.model.entity.ElderRoom;
import com.plugin.manage.mapper.ElderRoomMapper;
import com.plugin.manage.service.IRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 房间管理服务实现类
 *
 * @author mark
 * @date 2025-07-31
 */
@Service
public class RoomServiceImpl extends ServiceImpl<ElderRoomMapper, ElderRoom> implements IRoomService {

    @Autowired
    private ElderRoomMapper roomMapper;

    /**
     * 获取可用房间数量
     * 统计elder_room表中status=1（可用）的记录数
     * 
     * @return 可用房间数量
     */
    @Override
    public Long getAvailableRoomCount() {
        return roomMapper.countAvailableRooms();
    }
}
